package com.bole.service.impl;

import com.bole.dao.CarDao;
import com.bole.pojo.TbCarDo;
import com.bole.service.CarService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CarServiceImpl implements CarService {

    @Resource
    private CarDao carDao;

    @Override
    public List<TbCarDo> getCarByUserId(Long userId) {
        return carDao.findAllBySellUserId(userId);
    }

    @Override
    public void revoke(Long carId) {
        TbCarDo tbCarDo = carDao.findCarById(carId);
        tbCarDo.setStatus(4);
        carDao.save(tbCarDo);
    }
}
